{% extends "admin/filer/base_site.html" %}
{% load adminmedia filer_admin_tags filermedia i18n %}
{% load url from future %}

{% block extrahead %}{{ block.super }}
{# upload stuff #}
{{ media.js }}
<script type="text/javascript" src="{% admin_js_base %}jquery.min.js"></script>
<script type="text/javascript" src="{% filer_staticmedia_prefix %}js/jquery-ui-1.7.2.custom.min.js"></script>
<script type="text/javascript" src="{% filer_staticmedia_prefix %}js/jquery.cookie.js"></script>
<script type="text/javascript" src="{% filer_staticmedia_prefix %}js/fileuploader.js"></script>
<script type="text/javascript" src="{% admin_js_base %}admin/RelatedObjectLookups.js"></script>
<script type="text/javascript" src="{% filer_staticmedia_prefix %}js/popup_handling.js"></script>
{% if action_form %}{% if actions_on_top or actions_on_bottom %}
<script type="text/javascript">
(function($) {
    $(document).ready(function($) {
        $("tr input.action-select").actions();
    });
})(django.jQuery);
</script>
{% endif %}{% endif %}
{% endblock %}

{% block coltype %}colMS{% endblock %}
{% block bodyclass %}change-list filebrowser{% endblock %}


{% block extrastyle %}{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% admin_css_base %}changelists.css" />
{{ media.css }}
{% if action_form %}
  {% url 'admin:jsi18n' as jsi18nurl %}
  <script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script>
{% endif %}
{% if query.pop %}
<style type="text/css">
    #header { display: none; }
</style>
{% endif %}
{% if not actions_on_top and not actions_on_bottom %}
<style>
    #changelist table thead th:first-child {width: inherit}
</style>
{% endif %}
{% endblock %}

{% block breadcrumbs %}
{% with folder as instance %}
{% include "admin/filer/breadcrumbs.html" %}
{% endwith %}
{% endblock %}


{% block sidebar %}
<div id="content-related">
    {% include "admin/filer/tools/clipboard/clipboard.html" %}
</div>
{% endblock %}


{% block content_title %}

{% if folder.can_have_subfolders %}<a id="id_new_folder" href="{% url 'admin:filer-directory_listing-make_root_folder' %}?parent_id={{ folder.id }}" class="btn btn-primary" onclick="return showAddAnotherPopup(this);" title="{% trans "Adds a new Folder" %}">{% trans "New Folder" %}</a>{% endif %}
<a id="id_upload_button" href="#" class="btn" title="{% trans 'upload files' %}">{% trans 'Upload' %}</a>
{% include 'admin/filer/tools/upload_button_js.html' %}

{% include "admin/filer/tools/search_form.html" %}

{% endblock %}
{% block content %}

    <div class="span9">
<div id="content-main">
    
    <div class="module" id="changelist">
        
        {% if not folder.is_root %}
        <h1>{% if folder.parent %}<a href="{% url 'admin:filer-directory_listing' folder.parent.id %}{% if is_popup %}?_popup=1{% if select_folder %}&select_folder=1{% endif %}{% endif %}" title="{% trans "Go back to the parent folder" %}">&uarr;</a>{% else %}<a href="{% url 'admin:filer-directory_listing-root' %}{% if is_popup %}?_popup=1{% if select_folder %}&select_folder=1{% endif %}{% endif %}" title="{% trans "Go back to" %} {% trans "root"|title %} {% trans "folder" %}">&uarr;</a>{% endif %}
            <img src="{{ folder.icons.32 }}" alt="{% trans "Folder Icon" %}" /> {{ folder.name }}
            <small>({% blocktrans count folder.children_count as counter %}1 folder{% plural %}{{ counter }} folders{% endblocktrans %}, {% blocktrans count folder.file_count as counter %}1 file{% plural %}{{ counter }} files{% endblocktrans %})</small>
            <span>
                {% if is_popup %}
                    {% if select_folder and folder.file_type == 'Folder' %}<a class="insertlink insertlinkButton" href="" onclick="opener.dismissRelatedFolderLookupPopup(window, {{ folder.id }}, '{{ folder.pretty_logical_path }}'); return false;" >&nbsp;</a>{% endif %}
                {% else %}<a style="display: block; float: right;" class="btn btn-mini changelink" href="{% url 'admin:filer_folder_change' folder.id %}" title="{% trans "Change current folder details" %}">{% trans "Change" %}</a>{% endif %}
            </span>
        </h1>
        {% else %}{% if folder.is_smart_folder %}
        <h1><a href="{% url 'admin:filer-directory_listing-root' %}{% if is_popup %}?_popup=1{% if select_folder %}&select_folder=1{% endif %}{% endif %}">&uarr;</a>
            <img src="{{ folder.icons.32 }}" alt="{% trans "Folder Icon" %}" /> {{ folder.name }}
        </h1>
        {% endif %}
        {% endif %}
        <form id="changelist-form" action="" method="post">{% csrf_token %}
        {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
        {% if action_form and actions_on_top and paginator.count and not select_folder and not is_popup %}{% filer_actions %}{% endif %}

        {% include "admin/filer/folder/directory_table.html" %}
        {% if action_form and actions_on_bottom and paginator.count and not select_folder and not is_popup %}{% filer_actions %}{% endif %}
        </form>
    </div>
</div>

    </div>

{% endblock %}
